package com.mycompany.myapp.web.rest.controller;

import com.mycompany.myapp.service.OrderService;
import com.mycompany.myapp.service.dto.OrderDTO;
import com.mycompany.myapp.web.rest.utils.ResultObj;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"后台管理-订单管理"})
@RestController
@RequestMapping("/api")
public class MOrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/morder/findByParams")
    private ResultObj findByParams(@RequestParam(value = "pagenum") int pageNum,
                                 @RequestParam(value = "pagesize") int pageSize,
                                 @RequestParam(value = "query") String username){
        return orderService.findByParams(pageNum,pageSize,username);
    }

//    @ApiOperation("修改用户信息")
    @PutMapping("/morder/update")
    public ResultObj updateOrderInfo(@RequestBody OrderDTO orderDTO){
        return orderService.updateOrderInfo(orderDTO);
    }

}
